#include "sortDnaListTest.h"
#include <algorithm>
using namespace std;


SortDnaListTest::SortDnaListTest()
{
}
 
void SortDnaListTest::setUp()
{
}

void SortDnaListTest::tearDown()
{
}

void SortDnaListTest::testSort()
{
	float t0 = 40;
	float t1 = 30;
	float t2 = 20;
	float t3 = 10;
	size_t size = 20;	
	
	DnaSeq * l1 = createList(size, 24, t0, t1, t2, t3);
	
	l1 = sortDnaList(l1, size);
	
	string prec = "";
	conv2string(l1[0], prec);
	string tmp;
	
	for_each(l1 + 1 , l1 + size,
		[&prec, &tmp](DnaSeq s)
		{
			tmp="";
			conv2string(s, tmp);
			CPPUNIT_ASSERT(prec < tmp);
			CPPUNIT_ASSERT(prec != tmp);
			prec = tmp;
		}
	);
}
